using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class location
{
    public location(float x,float y,float z)
    {
        this.x = x;
        this.y = y;
        this.z = z;
    }
    public float x;
    public float y;
    public float z;
}
public class CreateEmpty : MonoBehaviour
{
    public GameObject empty1;
    public GameObject empty2;
    public static location empty1_start = new location(0, 8, 7);
    public void create()
    {
        GameObject go;
        if (GameObject.Find("Player").GetComponent<PlayerInfo>().Goal <= 90)
        {
            go = Instantiate(empty1, new Vector3(8, 8, 7), Quaternion.identity);
            go.transform.rotation = Quaternion.Euler(0, 180, 90);
        }
        else
        {
            go = Instantiate(empty1, new Vector3(8, 8, 7), Quaternion.identity);
            go.transform.rotation = Quaternion.Euler(0, 180, 90);
            go = Instantiate(empty1, new Vector3(8, 8, 7), Quaternion.identity);
            go.transform.rotation = Quaternion.Euler(0, 180, 90);
        }   
        
                
        
        
        
    }
    // Start is called before the first frame update

    void Start()
    {
        InvokeRepeating("checkEmpty", 0f, 3f);
    }
    void checkEmpty()
    {
        if (GameObject.FindGameObjectWithTag("Empty") == null&&PlayerInfo.state==PlayerInfo.NOW.Playing)
        {
            create();
        }
    }
    // Update is called once per frame
    void Update()
    {
        
    }
}
